/**
 * Friendly Interactive Recursion Educator (FIRE)
 * COMS 4115: Programming Languages & Translators
 * Prof. Aho
 * 
 * @author Brian Lu
 * @author Sahar Hasan
 * @author Steve Hehl
 * @author Tristan Naumann
 * @version 2009-05-12
 */
package firesymbols;

import java.util.*;

/**
 * Represents the standard operations (+, -, *, %, =, etc) in order to type
 * check that LHS and RHS agree/what return type to yield.
 */
public class StandardFunctionSymbol extends Symbol{
	
	/**
	 * A signature consists of a list of return type, args...
	 * A single name can contain more than one signature.  For example,
	 * + can return an int if it takes two ints or a float if it takes
	 * all floats or a mix of floats and ints.
	 */
	private LinkedList<ArrayList<Symbol>> signatures = new LinkedList<ArrayList<Symbol>>();
	
	public StandardFunctionSymbol(String name){
		super(name);
		
	}
	
	/**
	 * Adds a signature to this standard function.
	 */
	public void addSignature(Symbol returnType, Symbol ... args){
		
		ArrayList<Symbol> sig = new ArrayList<Symbol>();
		
		sig.add(0, returnType);
		
		for(int i = 0; i < args.length; i++){
			sig.add(i+1, args[i]);
		}
		
		signatures.add(sig);
		
	}
	
	/**
	 * Return the signatures for a function.
	 * @return the signatures a list of <ret, args...> lists
	 */
	public LinkedList<ArrayList<Symbol>> getSignatures(){
		
		return signatures;
	}
		

}
